
class Channel
{
public:
    Channel(int pfd,pid_t id):_pfd(pfd),_id(id)
    {}
    void close()
    {
        int n = ::close(_pfd);
        if(n == 0)
        std::cout << "关闭成功,pfd:" << _pfd << std::endl;
        else 
        std::cout << "关闭失败" << std::endl;
    }
    pid_t Getpid()
    {
        return _id;
    }
    ~Channel()
    {}
private:
    int _pfd;
    pid_t _id;
};